home *** CD-ROM | disk | FTP | other *** search
/ Software of the Month Club 2000 October / Software of the Month - Ultimate Collection Shareware 277.iso / pc / PROGRAMS / UTILITY / WINLINUX / DATA1.CAB / programs_-_include / ASM-MIPS / HARDIRQ.H < prev    next >
C/C++ Source or Header  |  1999-09-17  |  989b  |  39 lines

  1. /* $Id: hardirq.h,v 1.5 1998/08/29 21:20:21 ralf Exp $
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Copyright (C) 1997, 1998 by Ralf Baechle
  8.  */
  9. #ifndef __ASM_MIPS_HARDIRQ_H
  10. #define __ASM_MIPS_HARDIRQ_H
  11.  
  12. #include <linux/tasks.h>
  13.  
  14. extern unsigned int local_irq_count[NR_CPUS];
  15.  
  16. /*
  17.  * Are we in an interrupt context? Either doing bottom half
  18.  * or hardware interrupt processing?
  19.  */
  20. #define in_interrupt() ({ int __cpu = smp_processor_id(); \
  21.     (local_irq_count[__cpu] + local_bh_count[__cpu] != 0); })
  22.  
  23. #ifndef __SMP__
  24.  
  25. #define hardirq_trylock(cpu)    (local_irq_count[cpu] == 0)
  26. #define hardirq_endlock(cpu)    do { } while (0)
  27.  
  28. #define hardirq_enter(cpu)    (local_irq_count[cpu]++)
  29. #define hardirq_exit(cpu)    (local_irq_count[cpu]--)
  30.  
  31. #define synchronize_irq()    barrier();
  32.  
  33. #else
  34.  
  35. #error No habla MIPS SMP
  36.  
  37. #endif /* __SMP__ */
  38. #endif /* __ASM_MIPS_HARDIRQ_H */
  39.